import { createRouter, createWebHistory } from "vue-router";
import HomeView from "@/pages/HomeView.vue";
import NavBar from "@/pages/NavBar.vue";
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      redirect: "/login",
    },
    {
      path: "/detail",
      component: () => import("@/pages/HomeCar/CartDetail.vue"),
    },
    {
      path: "/CartPay",
      component: () => import("@/pages/HomeCar/CartPay.vue"),
    },
    {
      path: "/ShaX",
      component: () => import("@/pages/HomeCar/shaxiang.vue"),
    },
    {
      path: "/nav",
      component: NavBar,
      redirect: "/nav/home",
      children: [
        {
          path: "home",
          component: HomeView,
        },
        {
          path: "my",
          component: () => import("../pages/MyView.vue"),
        },

        {
          path: "cart",
          component: () => import("@/pages/HomeCar/CartView.vue"),
        },
        {
          path: "message",
          component: () => import("@/pages/MessageView.vue"),
        },
        {
          path: "mine",
          component: () => import("@/pages/MineView.vue"),
        },
        {
          path: "shop",
          component: () => import("@/pages/ShopView.vue"),
        },
        {
          path: "info",
          component: () => import("@/pages/GoodsInfo.vue"),
        },
        {
          path: "/nav/messagelist",
          component: () => import("@/pages/message/MessageList.vue"),
        },
        {
          path: "/nav/chattool",
          component: () => import("@/pages/message/ChatTool.vue"),
        },
      ],
    },
    {
      path: '/order',//订单页
      component: () => import('@/pages/OrderView.vue')
    },
    {
      path: "/detail",
      component: () => import("@/pages/jsj/Detail.vue"),
    },
    {
      path: "/publish",
      component: () => import("@/pages/jsj/Publish.vue"),
    },
    {
      path: '/phonelogin',
      component: () => import('@/pages/login/PhoneLogin.vue')
    },
    {
      path: '/detail',
      component: () => import('@/pages/jsj/Detail.vue')
    },
    {
      path: '/wechatlogin',
      component: () => import('@/pages/login/WechatLogin.vue')
    },
    {
      path: "/login",
      component: () => import("@/pages/login/LoginView.vue"),
    },
    {
      path: "/register",
      component: () => import("@/pages/login/UserRegister.vue"),
    },
    {
      path: "/captcha",
      component: () => import("@/pages/login/CaptchaSendToPhone.vue"),
    },
    {
      path: "/setpassword",
      component: () => import("@/pages/login/SetPassword.vue"),
    },
    {
      path: "/shax",
      component: () => import("@/pages/jsj/ShaX.vue"),
    },
    {
      path: "/pay",
      component: () => import("@/pages/HomeCar/Success.vue"),
    },
    {
      path: '/chattool',
      component: () => import('@/pages/message/ChatTool.vue'),
    },
    {
      path: '/chatlist',
      component: () => import('@/pages/message/ChatList.vue'),
    },
    {
      path: '/chattool',
      component: () => import('@/pages/message/ChatTool.vue'),
    },
    {
      path: "/setpassword",
      component: () => import("@/pages/login/SetPassword.vue"),
    },
    {
      path: "/shax",
      component: () => import("@/pages/jsj/ShaX.vue"),
    },
    {
      path: "/pay",
      component: () => import("@/pages/HomeCar/Success.vue"),
    },


  ],
});



export default router;
